<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Struts2</title>
</head>
<body>
<p>To configure PicoContainer to handle the dependency injection of Struts2 actions, refer to the
web.xml below. For a start there is a slightly different listener to the one defined in the <a href="index.html">main
page</a>. Also, instead of using Struts2's servlet, use ours. Everything else from the standard Struts2 setup is
appropriate.</p>
<div class="source"><pre>
	<web-app>
	  <display-name>Struts 2 Webapp</display-name>

	  <context-param>
	    <param-name>webapp-composer-class</param-name>
	    <param-value>org.picocontainer.web.sample.ExampleStruts2Composer</param-value>
	  </context-param>

	  <filter>
	    <filter-name>picoFilter</filter-name>
	    <filter-class>org.picocontainer.web.struts2.PicoObjectFactory$ServletFilter</filter-class>
	  </filter>

	  <filter>
	    <filter-name>strutsFilter</filter-name>
	    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
	  </filter>

	  <filter-mapping>
	    <filter-name>picoFilter</filter-name>
	    <url-pattern>/*</url-pattern>
	  </filter-mapping>

	  <filter-mapping>
	    <filter-name>strutsFilter</filter-name>
	    <url-pattern>/*</url-pattern>
	  </filter-mapping>

	  <listener>
	    <listener-class>org.picocontainer.web.struts2.Struts2PicoServletContainerListener</listener-class>
	  </listener>

	  <welcome-file-list>
	    <welcome-file>index.html</welcome-file>
	  </welcome-file-list>

	</web-app>
</pre></div>
<p>The Maven example project is <a
  href="http://svn.codehaus.org/picocontainer/java/2.x/trunk/web/examples/struts2-webapp/">here</a>. Make sure you make
and configure your own <a href="composition.html">WebappComposer</a> implementation.  Note that we use a base class for
    Struts2 applications: Struts2Composer</p>
<p>See <a href="downloads.html">downloads</a> on how to download the struts2 module either using Maven or by downloading full distribution.</p>
</body>
</html>